home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / LGP250S1.ZIP / src / libgplus.5 / libgplus / tests / tlist.exp < prev    next >
Text File  |  1992-05-07  |  1KB  |  40 lines

  1.  
  2. intList a = sequence(1, 20);
  3. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
  4.  
  5. intList b = randseq(20);
  6. 28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6 
  7.  
  8. intList c = concat(a, b);
  9. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 28 27 5 17 44 6 9 40 15 26 49 35 15 48 13 27 25 25 9 6 
  10.  
  11. intList d = map(inc, a);
  12. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 
  13.  
  14. intList e = reverse(a);
  15. 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
  16.  
  17. intList f = select(is_odd, a);
  18. 1 3 5 7 9 11 13 15 17 19 
  19.  
  20. int  red = a.reduce(plus, 0);
  21. 210
  22. int second = a[2];
  23. 3
  24. intList g = combine(plus, a, b);
  25. 29 29 8 21 49 12 16 48 24 36 60 47 28 62 28 43 42 43 28 26 
  26.  
  27. g.del(is_odd);
  28. 8 12 16 48 24 36 60 28 62 28 42 28 26 
  29.  
  30. b.sort(int_compare);
  31. 5 6 6 9 9 13 15 15 17 25 25 26 27 27 28 35 40 44 48 49 
  32.  
  33. intList h = merge(a, b, int_compare);
  34. 1 2 3 4 5 5 6 6 6 7 8 9 9 9 10 11 12 13 13 14 15 15 15 16 17 17 18 19 20 25 25 26 27 27 28 35 40 44 48 49 
  35.  
  36. h via Pix:
  37. 1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 8, 9, 9, 9, 10, 11, 12, 13, 13, 14, 15, 15, 15, 16, 17, 17, 18, 19, 20, 25, 25, 26, 27, 27, 28, 35, 40, 44, 48, 49, 
  38.  
  39. done
  40.